package me.firstapp.manage.cqssc;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import me.firstapp.common.json.SingleObject;
import me.firstapp.common.module.zerone.JsonCqsscLotteryResult;
import me.firstapp.manage.common.BaseManage;
import me.firstapp.spi.zerone.CqsscService;

@Controller
@RequestMapping(value = "/cqsscManage")
public class LotteryResultManagePage extends BaseManage {

	@Autowired
	private CqsscService cqsscService;

	@RequestMapping(value = "/lotteryResultList.html", method = RequestMethod.GET)
	public ModelAndView advertisementListView(HttpServletRequest request, HttpServletResponse response,
			ModelMap modelMap) {
		return new ModelAndView("cqssc/lotteryResultList", modelMap);
	}

	@RequestMapping(value = "/lotteryResultAdd.html", method = RequestMethod.GET)
	public ModelAndView lotteryResultAddView(HttpServletRequest request, HttpServletResponse response,
			ModelMap modelMap) {
		return new ModelAndView("cqssc/lotteryResultAdd", modelMap);
	}

	@RequestMapping(value = "/lotteryResultBatch.html", method = RequestMethod.GET)
	public ModelAndView lotteryResultBatchView(HttpServletRequest request, HttpServletResponse response,
			ModelMap modelMap) {
		return new ModelAndView("cqssc/lotteryResultBatch", modelMap);
	}

	@RequestMapping(value = "/lotteryResultUpdate.html", method = RequestMethod.GET)
	public ModelAndView lotteryResultUpdateView(Long id, HttpServletRequest request, HttpServletResponse response,
			ModelMap modelMap) {
		SingleObject<JsonCqsscLotteryResult> result = cqsscService.findCqsscLotteryResultById(id);
		modelMap.put("lotteryResult", result.getObject());
		modelMap.put("id", id);
		return new ModelAndView("cqssc/lotteryResultUpdate", modelMap);
	}
}
